<template>
	<view class="user">
		<view class="top">
			<image src="../../static/images/history.png"></image>
			<text>历史记录</text>
		</view>
		<view class="content">
			<view class="row" v-for="item in newsArr">
				<Newsbox :newsObj="item"></Newsbox>
				<!-- 自定义组件默认引入 -->
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				newsArr:[],
			}
		},
		onShow(){
			this.getNewsArr();
		},
		methods: {
			getNewsArr(){
				this.newsArr=uni.getStorageSync('news_history');
			}
		}
	}
</script>

<style lang="scss" scoped>
.user{
	.top{
		padding: 50rpx;
		background: #f8f8f8;
		color:#555;
		display: flex;
		flex-direction: column;
		justify-content: center;
		
		align-items: center;
		image{
			width:200rpx;
			height:200rpx;
		}
		text{
			padding-top: 20rpx;
		}
	}
	.content{
		padding: 25rpx;
		.row{
			padding: 20rpx 0;
			border-bottom: 1rpx #999 dotted;
		}
	}
}
</style>
